package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
)

// / http客户端
func main() {
	// 向服务器发送GET请求
	response, err := http.Get("http://example.com")
	if err != nil {
		fmt.Println("Error making GET request:", err)
		return
	}
	defer response.Body.Close()

	// 读取响应内容
	body, err := ioutil.ReadAll(response.Body)
	if err != nil {
		fmt.Println("Error reading response:", err)
		return
	}

	fmt.Println("Response from server:", string(body))
}
